"""
 encoding    : utf-8
 @File       : getabspath.py
 @Author     : qin
 @Version    :
 @Description:
 @Date       : 2024/06/19
"""
import os
def getAbsPath(path):
    '''请传入需要查找的文件名和父路径名称
    列如：data/login_data.xlsx
    '''
    path1 = path
    currentPath = os.path.abspath(__file__)
    cutNum = currentPath.find('automatic_test_oa_system')
    path2 = currentPath[:cutNum + 25]
    return path2 + path1

if __name__ == '__main__':
    print(getAbsPath(r'data\daifashiwu_data.xlsx'))